<?php
/**
 * Template Name: Archives Page
 *
 * A custom page template for an archives page.
 * Selectable from a dropdown menu on the edit page screen.
 *
 * @package dkret3
 * @since 3.6
 */

get_header() ?>

    <div id="container">

        <?php /* dkret3 Hook */ do_action( 'dkret_before_container' ); ?>    

        <div id="content" role="main">

            <?php /* dkret3 Hook */ do_action( 'dkret_before_content' ); ?>

            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

                    <?php /* dkret3 Hook */ do_action( 'dkret_before_entry' ); ?>

                    <div class="entry-content">

                        <?php the_content(); ?>

                        <?php if ( function_exists( 'clean_my_archives' ) ) : echo clean_my_archives(); ?>

                        <?php elseif ( function_exists( 'smart_archives' ) ) : smart_archives(); ?>

                        <?php elseif ( function_exists( 'wp_smart_archives' ) ) : wp_smart_archives(); ?>

                        <?php elseif ( function_exists( 'srg_clean_archives' ) ) : srg_clean_archives(); ?>

                        <?php else : ?>

                            <h2><?php _e( 'Archives by category', 'dkret' ); ?></h2>

                            <ul class="xoxo category-archives">
                                <?php wp_list_categories( array( 'feed' => __( 'RSS', 'dkret' ), 'show_count' => true, 'use_desc_for_title' => false, 'title_li' => false ) ); ?>
                            </ul><!-- .xoxo .category-archives -->

                            <h2><?php _e( 'Archives by month', 'dkret' ); ?></h2>

                            <ul class="xoxo monthly-archives">
                                <?php wp_get_archives( array( 'show_post_count' => true, 'type' => 'monthly' ) ); ?>
                            </ul><!-- .xoxo .monthly-archives -->

                        <?php endif; ?>

                        <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'dkret' ), 'after' => '</div>' ) ); ?>

                    </div><!-- .entry-content -->

                    <?php /* dkret3 Hook */ do_action( 'dkret_after_entry' ); ?>

                </div><!-- #post-ID -->

                <?php /* dkret3 Hook */ do_action( 'dkret_after_singular' ); ?>

                <?php comments_template( '', true ); ?>

                <?php endwhile; ?>

            <?php else: ?>

                <p class="no-data">
                    <?php _e( 'Sorry, no page matched your criteria.', 'dkret' ); ?>
                </p><!-- .no-data -->

            <?php endif; ?>

            <?php /* dkret3 Hook */ do_action( 'dkret_after_content' ); ?>

        </div><!-- #content -->

        <?php /* dkret3 Hook */ do_action( 'dkret_after_container' ); ?>

    </div><!-- #container -->

<?php get_sidebar() ?>
<?php get_footer() ?>